{% extends "base.html" %} {# Django wants this first, even before comments #}

{% comment %}
Copyright 2012 Google Inc.  All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License.  You may obtain a copy
of the License at: http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distrib-
uted under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
OR CONDITIONS OF ANY KIND, either express or implied.  See the License for
specific language governing permissions and limitations under the License.
{% endcomment %}

{% block content %}
  <div class="cm-error-box">
    {% if exception.subject %}
      You're signed in as {{exception.subject.email}},
      <!-- map access roles -->
      {% if exception.role == 'MAP_VIEWER' or exception.role == 'MAP_EDITOR' or exception.role == 'MAP_OWNER' %}
        but you don't have
        {% if exception.role == 'MAP_VIEWER' %} viewer {% endif %}
        {% if exception.role == 'MAP_EDITOR' %} editor {% endif %}
        {% if exception.role == 'MAP_OWNER' %} owner {% endif %}
        access to that map.
        (You could try asking the owner of the map for access,
        or try <a href="{{login_url}}">signing in as a different user</a>.)
      {% else %}
        <!-- domain access roles -->
        {% if exception.role == 'MAP_CREATOR' or exception.role == 'CATALOG_EDITOR' or exception.role == 'DOMAIN_ADMIN' %}
          but you don't have permission to
          {% if exception.role == 'MAP_CREATOR' %} create new maps in the {% endif %}
          {% if exception.role == 'CATALOG_EDITOR' %} edit the catalog for the {% endif %}
          {% if exception.role == 'DOMAIN_ADMIN' %} administer the {% endif %}
          domain {{exception.target}}.
        {% else %}
          {% if exception.role == 'ADMIN' %}
            but you are not a site administrator.
          {% else %}
            but you don't have permission to access this page.
          {% endif %}
        {% endif %}
        (You could try asking a site administrator for access,
        or try <a href="{{login_url}}">signing in as a different user</a>.)
      {% endif %}
    {% else %}
      Please <a href="{{login_url}}">sign in</a> to get access.
    {% endif %}
    <br>&nbsp;<br>
    Return to the <a href="{{root}}">default map</a>.
  </div>
{% endblock content %}
